/* eslint-disable @typescript-eslint/no-explicit-any */
import { service } from "./request";
// 获取门店信息
export async function getStore() {
  const data = await service.get("zxl/store");
  return data;
}
// 获取车型信息
export async function getVesearch() {
  const data = await service.get("zxl/vesearch");
  return data;
}
// 获取车辆信息
export async function getVehicle(name: string, vstatus: string, sid: string) {
  const data = await service.get(
    `zxl/vsearch?name=${name}&vstatus=${vstatus}&sid=${sid}`
  );
  return data;
}
// 修改车辆信息
export async function updateVehicle(
  values: string,
  previewImage: string,
  previewImage1: string,
  previewImage2: string,
  id: string
) {
  const data = await service.post("zxl/Update", {
    values,
    previewImage,
    previewImage1,
    previewImage2,
    id,
  });
  return data;
}
// 添加车辆信息
export async function addVehicle(
  values: string,
  previewImage: string,
  previewImage1: string,
  previewImage2: string
) {
  const data = await service.post("zxl/Cvehicle", {
    values,
    previewImage,
    previewImage1,
    previewImage2,
  });
  return data;
}
// 修改车辆信息中的租金
export async function updateVehicleRent(values: string, id: string) {
  const data = await service.post("zxl/Urent", { values, id });
  return data;
}
// 删除车辆信息
export async function deleteVehicle(id: string) {
  const data = await service.post("zxl/Dvehicle", { id });
  return data;
}
// 上传图片
export async function uploadImage(values: any) {
  const data = await service.post("zxl/upload", { values });
  return data;
}
// 调度门店
export async function dispatchStore(values: any, id: string | undefined) {
  const data = await service.post("zxl/Uvehicle", { values, id });
  return data;
}
// 获取用户信息
export async function getUserInfo() {
  const data = await service.get("zxl/User");
  return data;
}
// 修改车型
export async function updateVehicleType(
  values: string,
  previewImage: string,
  id: string
) {
  const data = await service.post("zxl/Uvehiclemodel", {
    values,
    previewImage,
    id,
  });
  return data;
}
// 添加车型
export async function addVehicleType(values: string, previewImage: string) {
  const data = await service.post("zxl/Cvehiclemodel", {
    values,
    previewImage,
  });
  return data;
}
// 删除车型
export async function deleteVehicleType(id: string) {
  const data = await service.post("zxl/Dvehiclemodel", { id });
  return data;
}
// 获取车型信息+搜索
export async function getVehicleType(
  brand: string,
  selectedYears: string[],
  seats: string,
  boxtype: string,
  displacement: string,
  TransmissionType: string
) {
  console.log(
    brand,
    selectedYears,
    seats,
    boxtype,
    displacement,
    TransmissionType
  );
  const data = await service.get(
    `zxl/vesearch?brand=${brand}&year=${selectedYears}&seats=${seats}&boxtype=${boxtype}&displacement=${displacement}&TransmissionType=${TransmissionType}`
  );
  return data;
}
